<!-- 
@since 2018/03/06
@modified 2019/10/05 00:25:12
-->

{% init files = [] %}
{% init show_opts = True %}
{% init show_cdate = False %}
{% init show_mdate = False %}
{% init show_adate = False %}
{% init show_next  = False %}
{% init file = None %}
{% init dir_type = "" %}
{% init tags = "" %}
{% init back_url = "/note/books" %}

{% include "note/view_header.html" %}
<div class="grid-row note-list">
    {% if _has_login %}
        <a class="dialog-link" href="{{back_url}}">
            <div class="book-item">
                <i class="fa fa-mail-reply black"></i>
                
                <span>上级目录</span>
                <span class="book-size">
                    <i class="fa fa-chevron-right"></i>
                </span>
            </div>
        </a>
    {% end %}

    {% for item in files %}
        <a class="dialog-link" href="{{item.url}}?dir_type={{dir_type}}&tags={{tags}}">
            <div class="book-item">
                {% if item.type == "group" %}
                    <i class="fa fa-folder orange"></i>
                {% elif item.type == "csv" %}
                    <i class="fa fa-table black"></i>
                {% elif item.type == "gallery" %}
                    <i class="fa fa-image black"></i>
                {% elif item.type == "trash" %}
                    <i class="fa fa-trash black"></i>
                {% elif item.type == "gear" %}
                    <i class="fa fa-gear black"></i>
                {% elif item.type == "cube" %}
                    <i class="fa fa-cube black"></i>
                {% else %}
                    <i class="fa fa-file-text-o black"></i>
                {% end %}

                {%if item.priority>0%}
                    <i class="fa fa-thumb-tack black"></i>
                {%end%}
                
                <span>{{item.name}}</span>
                <span class="book-size">
                    {% if show_cdate %}
                        {{format_date(item.ctime).replace('-', '/')}}
                    {% end %}

                    {% if show_mdate %}
                        {{format_date(item.mtime).replace('-', '/')}}
                    {% end %}

                    {% if show_adate %}
                        {{format_date(item.atime).replace('-', '/')}}
                    {% end %}

                    {% if show_next %}
                        <i class="fa fa-chevron-right"></i>
                    {% end %}
                </span>
            </div>
        </a>
    {% end %}
</div>

